package com.example.leetcode.graph;

import com.example.leetcode.graph.common.GraphUtils;
import com.example.leetcode.string.common.StringUtils;

import java.util.List;

class Solution721 {
    public List<List<String>> accountsMerge(List<List<String>> accounts) {
        return GraphUtils.accountsMerge(accounts);
    }
}

public class leetcode721 {
    public static void main(String[] args) {
        Solution721 solution721 = new Solution721();
        String[][] accounts = {
                {"John", "johnsmith@mail.com", "john00@mail.com"},
                {"John", "johnnybravo@mail.com"},
                {"John", "johnsmith@mail.com", "john_newyork@mail.com"},
                {"Mary", "mary@mail.com"}
        };
        String[][] accounts1 = {
                {"Gabe", "Gabe0@m.co", "Gabe3@m.co", "Gabe1@m.co"},
                {"Kevin", "Kevin3@m.co", "Kevin5@m.co", "Kevin0@m.co"},
                {"Ethan", "Ethan5@m.co", "Ethan4@m.co", "Ethan0@m.co"},
                {"Hanzo", "Hanzo3@m.co", "Hanzo1@m.co", "Hanzo0@m.co"},
                {"Fern", "Fern5@m.co", "Fern1@m.co", "Fern0@m.co"}
        };

        System.out.println(solution721.accountsMerge(StringUtils.convertArrayToList(accounts)));
        System.out.println(solution721.accountsMerge(StringUtils.convertArrayToList(accounts1)));
    }
}
